﻿using System.IO;
using System.Web;
using Newtonsoft.Json;

namespace SelfMadeMillioniare.API.Helpers
{
    public class JsonHelper<T>
    {
        public static T GetModelFromJson()
        {
            string json = new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd();

            T model = JsonConvert.DeserializeObject<T>(json);

            return model;
        }
    }
}